#pragma once

#include "../Shared/GObjHelpers.hpp"

namespace BuildNG
{
  class CLangReference;
  
  class CCompilerBackend : public Object
  {
  public:
    static Glib::RefPtr<CCompilerBackend> get_compiler_backend(const Glib::ustring &name);

    virtual bool build_source_file(
      BuildContext&                 context,
      const Glib::ustring&          source_file_name,
      Glib::ustring&                obj_file_name,
      Glib::RefPtr<ErrorListener>   error_listener) = 0;
    virtual bool link(
      BuildContext&                 context,
      const std::vector<Glib::ustring> &object_files,
      Glib::RefPtr<ErrorListener>   error_listener) = 0;
      
    // settings related functions
    virtual void add_reference(Glib::RefPtr<CLangReference> reference) = 0;

    enum Language
    {
      Language_PlainC,
      Language_CPlusPlus,
    };
    virtual void set_language(Language language) = 0;
  };
}
